package com.xueyi.aixihu.annotation.aspect;

import com.xueyi.aixihu.response.base.AesResponse;
import com.xueyi.aixihu.response.base.BaseResponse;
import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

/**
 * 描述 Ase的切面
 *
 * @auther 俞烨
 * @date 2022-08-02 11
 */
@Aspect
@Component
public class AseAspect {

    @Around("@annotation(com.xueyi.aixihu.annotation.Aes)")
    public AesResponse ase(ProceedingJoinPoint pjp) throws Throwable {

        // 对数据进行加密
        return AesResponse.aes((BaseResponse) pjp.proceed());
    }
}
